/* 全局样式 */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: var(--calcite-font-family);
}

/* 主题变量 */
:root {
  --theme-bg-primary: #ffffff;
  --theme-bg-secondary: #f8f9fa;
  --theme-text-primary: #212529;
  --theme-text-secondary: #6c757d;
  --theme-border: #dee2e6;
  --theme-accent: #007bff;
}

/* 深色主题 */
[data-theme="dark"] {
  --theme-bg-primary: #1a1a1a;
  --theme-bg-secondary: #2d2d2d;
  --theme-text-primary: #ffffff;
  --theme-text-secondary: #adb5bd;
  --theme-border: #495057;
  --theme-accent: #0d6efd;
}

/* 蓝色主题 */
[data-theme="blue"] {
  --theme-bg-primary: #e3f2fd;
  --theme-bg-secondary: #bbdefb;
  --theme-text-primary: #0d47a1;
  --theme-text-secondary: #1976d2;
  --theme-border: #90caf9;
  --theme-accent: #1565c0;
}

/* 绿色主题 */
[data-theme="green"] {
  --theme-bg-primary: #e8f5e8;
  --theme-bg-secondary: #c8e6c9;
  --theme-text-primary: #1b5e20;
  --theme-text-secondary: #388e3c;
  --theme-border: #a5d6a7;
  --theme-accent: #2e7d32;
}

/* 标题栏样式 */
.header-bar {
  height: 70px;
  background: linear-gradient(135deg, var(--theme-bg-secondary) 0%, var(--theme-accent) 100%);
  border-bottom: 2px solid var(--theme-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-sizing: border-box;
  position: relative;
  z-index: 1000;
}

.header-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
  pointer-events: none;
}

.header-title-section {
  position: relative;
  z-index: 1;
}

.header-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--theme-text-primary);
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
}

.header-subtitle {
  font-size: 1rem;
  color: var(--theme-text-primary);
  margin: 0.3rem 0 0 0;
  opacity: 0.9;
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* 主容器 - 左右布局 */
.main-container {
  display: flex;
  height: calc(100vh - 70px);
  position: relative;
}

/* 左侧菜单面板 */
.left-panel {
  width: 320px;
  background-color: var(--theme-bg-primary);
  border-right: 1px solid var(--theme-border);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: width 0.3s ease;
  z-index: 100;
}

/* 折叠状态 */
.left-panel.collapsed {
  width: 60px;
}

/* 折叠按钮 */
.collapse-btn {
  position: absolute;
  top: 50%;
  right: -15px;
  transform: translateY(-50%);
  background: var(--theme-bg-primary);
  border: 2px solid var(--theme-border);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.collapse-btn:hover {
  background: var(--theme-accent);
  color: white;
}

.collapse-btn calcite-icon {
  transition: transform 0.3s ease;
}

.left-panel.collapsed .collapse-btn calcite-icon {
  transform: rotate(180deg);
}

/* 左侧面板头部 */
.panel-header {
  padding: 1rem;
  background-color: var(--theme-bg-secondary);
  border-bottom: 1px solid var(--theme-border);
}

.panel-header h2 {
  margin: 0;
  color: var(--theme-text-primary);
  font-size: 1.2rem;
}

/* 菜单内容区域 */
.menu-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

/* 右侧地图容器 */
.right-panel {
  flex: 1;
  position: relative;
}

#viewDiv {
  height: 100%;
  width: 100%;
}

/* 菜单项样式 */
.menu-section {
  margin-bottom: 1rem;
}

.menu-section h3 {
  margin: 0 0 0.5rem 0;
  padding: 0 1rem;
  font-size: 1rem;
  color: var(--theme-text-primary);
  font-weight: 600;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.menu-item:hover {
  background-color: var(--theme-bg-secondary);
}

.menu-item calcite-icon {
  margin-right: 0.5rem;
  color: var(--theme-text-secondary);
}

.menu-item span {
  color: var(--theme-text-primary);
}

/* 图层控制样式 */
.layer-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
}

.layer-control span {
  color: var(--theme-text-primary);
}

/* 底图选择器样式 */
.basemap-selector {
  position: absolute;
  bottom: 15px;
  left: 10px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--theme-border);
  border-radius: 6px;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  height: 32px;
  width: auto;
}

.basemap-selector calcite-label {
  margin: 0;
}
